<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>在线转换</title>
	<script src="../dist/nzh.js"></script>
</head>
<body>
	<input id="n" type="text" onkeyup="show(this.value)" value="1023456789.123" />
	<button onclick="show($('n').value)">计算</button>
	<br />结果：<br />
	<textarea id="n1" cols="100" rows="15" style="max-width:100%;"></textarea>
	<script>
		$ = function(){
			return document.getElementById.apply(document,arguments);
		}

		var custom = new Nzh({
			ch: '〇壹贰叁肆伍陆柒捌玖'
			,ch_u: '个拾佰仟万亿兆京'
			,ch_f: '负'
			,ch_d: '点'
			,m_t: '￥'
			,m_z: '正'
			,m_u: '元角分厘'
		});


		function show(n){
			var str = '';
			str += '>>>CN<<< \n';
			str += Nzh.cn.encodeS(n) + '\n';
			str += Nzh.cn.encodeB(n) + '\n';
			str += Nzh.cn.toMoney(n) + '\n';
			str += '\n';
			str += '>>>HK<<< \n';
			str += Nzh.hk.encodeS(n) + '\n';
			str += Nzh.hk.encodeB(n) + '\n';
			str += Nzh.hk.toMoney(n) + '\n';
			str += '\n';
			str += '>>>CUSTOM<<< \n';
			str += custom.encode(n) + '\n';
			str += custom.toMoney(n) + '\n';
			$('n1').value = str;
		}

		show($('n').value);
	</script>
</body>
</html>